home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 76 / MF_UK_76_1.iso / Education Feature / MicroWorlds 2.03 Try Me / MicroWorlds 2.03 Try Me.rsrc / TEXT_529_ask.txt < prev    next >
Encoding:
Text File  |  1998-05-08  |  947 b   |  36 lines

  1. ask who instruction-list
  2.  
  3. Temporarily tells each element in the first input to run the instruction list. The first input can be the name(s) of one or many turtles or text box names. Ask does not change the current turtle or text box. The apostrophe can be used to ask a turtle to report something. Turtles have built-in properties: pos, heading, color, size, pensize, and shape. Variables can be assigned to turtles using turtlesown. 
  4.  
  5.  
  6. Examples: 
  7.  
  8. There are many turtles on the page.
  9.  
  10. ask [t1 t2 t3] [fd 50 rt 90 fd 50]
  11.  
  12. If you have two text boxes on the page and you want to keep Text1 current:
  13.  
  14. ask "text2 [print "hello]
  15.  
  16. If t1 is not the current turtle and you want to know its position:
  17.  
  18. show ask "t1 [pos]
  19.  
  20. Following are three examples of equivalent instructions:
  21.  
  22. show ask "t1 [pos]
  23. 0 0
  24. show t1's "pos
  25. 0 0
  26.  
  27. t2, setpos ask "t1 [pos]
  28. t2, setpos t1's "pos
  29.  
  30. turtlesown "gravity
  31. t1, setgravity 10
  32. show ask "t1 [gravity]
  33. 10
  34. show t1's "gravity
  35. 10
  36.